<?php 
session_start();
$userid=null;
if (isset($_SESSION["userid"])==false || $_SESSION["userid"]==null) {
	header("Location: index.php");
	exit;
} else {
	$userid = $_SESSION["userid"];
}
require("dbinit.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>YuHu - My Travel Agent</title>

<script type="text/javascript" src="./js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="./js/jquery.clock.js"></script>
<script type="text/javascript" src="./js/DateExpFunction.js"></script>

<link href="./css/cupertino/jquery-ui-1.7.2.custom2.css" rel="stylesheet" type="text/css" />
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<link rel="Shortcut Icon" type="image/png" href="./img/icon/logo-blue-16x16.png" />

<script type="text/javascript">
	$(function() {
		$(".accordion").accordion({
		    collapsible: true,
		    autoHeight: false
			});
		$('.myDatePicker_tour').datepicker({
			numberOfMonths: 2,
			showButtonPanel: true
		});
		$(".tabs").tabs();
	});

function btn_newatour_click(){
	$("#frm_main").attr("src","main_new_tour_page.php");
}

function btn_editTour_click(indexTour) {
	$("#frm_main").attr("src","main_edit_tour_page.php?indexTour=" + indexTour);
}

function btn_logout_click() {
	$.post("logout.php",{
	}, function(data){
		 window.location.reload();
	});
}
	</script>

</head>
<body>
<div id="outer">
	<div id="header">
		<p algin="center"><img src="./img/header-200x100.gif" /></p>
	</div>
	<div id="menu">
		<ul>
			<li class="first"><a href="#" accesskey="1" title="">Home</a></li>
			<li><a href="#" accesskey="2" title="">About Us</a></li>
			<li><a href="#" accesskey="3" title="">Products</a></li>
			<li><a href="#" accesskey="4" title="">Services</a></li>
			<li><a href="#" accesskey="5" title="">Contact Us</a></li>
		</ul>
	</div>
	<div id="content">
		<div id="primaryContentContainer">
			<div id="primaryContent">
<!--Main Area ----------------------------------------------------------------------------  -->
<iframe width="100%" height="350" name="frm_main" id="frm_main" src="main_welcome.php" style="border: 0;"></iframe>



<!--Main Area ----------------------------------------------------------------------------  -->	
			</div>
		</div>
	
		<div id="secondaryContent">
<!--Menu Area ----------------------------------------------------------------------------  -->	

<input type="button" name="btn_newatour" id="btn_newatour" value="New a Tour" style="width: 100%;" onclick="btn_newatour_click();"/>
<div id="mainMenu" class="accordion">
	<h3><a href="#">In Process</a></h3>
	<div id="mainMenu_InProcess" >
<?php 


$query = "SELECT * from ucMaintour where colEmail='" . $userid . "'";
$result = mysql_query($query, $link);
while ($row = mysql_fetch_assoc($result)) {
?><a href="#" onclick="btn_editTour_click('<?php echo $row["indexTour"]; ?>')"><?php echo $row["colTourname"]; ?></a><br /><?php 
}
mysql_close($link);
?>
	</div>
	<h3><a href="#">Share</a></h3>
	<div id="mainMenu_Share" >
		Share
	</div>	
	<h3><a href="#">Public</a></h3>
	<div id="mainMenu_Public" >
		Public
	</div>
	<h3><a href="#">History</a></h3>
	<div id="mainMenu_History" >
		History
	</div>		
</div>
<input type="button" name="btn_logout" id="btn_logout" value="Logout" style="width: 100%;" onclick="btn_logout_click()" />

<!--Menu Area ----------------------------------------------------------------------------  -->
		</div>
		<div class="clear"></div>
	</div>
	<div id="footer">
		<p>Copyright &copy; 2006 Sitename.com. Designed by <a href="http://www.freecsstemplates.org">Free CSS Templates</a></p>
	</div>
</div>
</body>
</html>